package gui;

/**
 *   Classe que cria um dialogo para deletar a account.
 * @author Amaury Medeiros
 * @author Danilo Freitas
 * @author Felipe Vieira
 * @author Nicholas Alexander
 * @author Paulo Victor
 *
 */
import sistema.Sistema;

import com.trolltech.qt.gui.QApplication;
import com.trolltech.qt.gui.QDialog;
import com.trolltech.qt.gui.QHBoxLayout;
import com.trolltech.qt.gui.QIcon;
import com.trolltech.qt.gui.QLabel;
import com.trolltech.qt.gui.QLineEdit;
import com.trolltech.qt.gui.QPushButton;
import com.trolltech.qt.gui.QVBoxLayout;
import com.trolltech.qt.gui.QLineEdit.EchoMode;

public class DeleteAccountDialog extends QDialog{
	
	private final String IMG_PATH = "ImHereM03/img/";
	private QPushButton cancelButton;
	protected QPushButton okButton;
	private QVBoxLayout layout;
	
	/**
	 * Construtor da classe.
	 */
	public DeleteAccountDialog(){
		this.setWindowTitle("Delete Account");
		this.setWindowIcon(new QIcon(IMG_PATH + "icon.png"));
		this.setStyleSheet("QDialog{background-image: url("+IMG_PATH + "background.png);}");
		this.setFixedSize(300,100);
		this.insertLayout();
	}
	
	/**
	 * Metodo que insere o layout do dialogo.
	 */
	private void insertLayout() {
		this.layout = new QVBoxLayout();
		QLabel text = new QLabel();
		text.setWordWrap(true);
		text.setText("<center>Are you sure do you want to delete your account?</center>");
		this.layout.addWidget(text);
		this.insertButtons();
		this.setLayout(this.layout);
	}
	
	/**
	 * Metodo que insere os botoes no layout da classe.
	 */
	private void insertButtons() {
		QHBoxLayout buttonsLayout = new QHBoxLayout();
		okButton = new QPushButton("OK");
		cancelButton = new QPushButton("Cancelar");
		cancelButton.clicked.connect(this, "close()");
		buttonsLayout.addWidget(cancelButton);
		buttonsLayout.addWidget(okButton);
		this.layout.addLayout(buttonsLayout);
	}
	
}
